package cn.tedu._01yuncat.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class UserRegParam {
    @Schema(description = "用户名", required = true)
    @Pattern(regexp = "^[a-zA-Z0-9][a-zA-Z0-9_-]{2,19}$", message = "用户名格式不正确")
    private String username;

    @Schema(description = "密码", required = true)
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]).{8,20}$",
            message = "密码必须包含大小写字母、数字和特殊字符，长度8-20位")
    private String password;

    @Schema(description = "邮箱", required = true)
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$",
            message = "邮箱格式不正确")
    private String email;

    @Schema(description = "手机号", required = true)
    @Pattern(regexp = "^1[3-9]\\d{9}$",
            message = "手机号格式不正确")
    private String phone;
}
